package com.hippo.core.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Description: 用户表
 * @Auther: tangxl
 * @Date: 2021/5/17 11:04
 */
@TableName("sys_user")
@Data
@Schema(description = "用户表")
public class SysUser implements Serializable {
  private static final long serialVersionUID = 1L;
  @TableId(value = "id",type = IdType.AUTO)
  @Schema(description = "主键ID",example = "1")
  private Integer id;
  @TableField("code")
  @Schema(description = "用户编码",example = "admin")
  private String code;
  @TableField("name")
  @Schema(description = "用户名称",example = "admin")
  private String name;
  @TableField("password")
  @Schema(description = "用户密码",example = "123456")
  private String password;
  @TableField("age")
  @Schema(description = "用户年龄",example = "18")
  private Integer age;
  @TableField("birthday")
  @Schema(description = "用户生日",example = "2021-05-17 11:04:00")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDateTime birthday;
  @TableField("sex")
  @Schema(description = "用户性别",example = "1")
  private Integer sex;
  @TableField("phone")
  @Schema(description = "用户电话",example = "13888888888")
  private String phone;
  @TableField("email")
  @Schema(description = "用户邮箱",example = "xxx.@qq.com")
  private String email;
  @TableField("address_id")
  @Schema(description = "用户地址ID",example = "1")
  private Integer addressId;
  @TableField(value = "create_time",fill = FieldFill.INSERT)
  @Schema(description = "创建时间",example = "2021-05-17 11:04:00")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime createTime;
  @TableField("login_time")
  @Schema(description = "登录时间",example = "2021-05-17 11:04:00")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime loginTime;
  @TableField(value = "status",fill = FieldFill.INSERT)
  @Schema(description = "状态",example = "1")
  private long status;

}
